<?php

namespace app\systems\logic;

use app\admin\logic\BasicLogic;
use app\api\logic\ApiOrderLogic;
use app\api\logic\ApiStockUpLogic;
use app\api\logic\CheckLogic;
use app\api\logic\LinXingOrderLogic;
use app\api\logic\TestLogic;
use app\api\logic\FeiShuMessageLogic;
use app\api\logic\TeamLogic;
use app\api\logic\UploadTestLogic;
use app\api\logic\Vip1688Logic;
use app\common\service\CommonExportInfoDetailService;
use app\common\service\JinyiApiService;
use app\common\service\CommonSystemImportInfoDetailService;
use app\common\service\CommonSystemImportService;
use app\common\service\CommonExportCsvTaskLogService;
use app\order\logic\OrderLogic;
use app\order\logic\OrderShipServiceLogic;
use app\order\logic\OrderSplitLogic;
use app\api\logic\ApiAdvLogic;
use app\api\logic\WebhookLogic;
use app\product\logic\ProductInventoryLogic;
use app\product\logic\ProductNewLogic;
use app\product\logic\ProductLogic;
use app\product\logic\ContractLogic;
use app\customer\logic\OrderRefundLogic;
use app\order\logic\OrderCheckLogisticsLogic;
use app\listing\logic\ListingLogic;
use app\listing\logic\ShopifyListingLogic;
use app\api\logic\KolMessageLogic;

class MqTaskServiceLogic extends BasicLogic
{
    public function __call($name, $arguments)
    {
        p($name);
        p($arguments);
    }


    /**
     * sku     跟卖异常数据获取队列
     * @author luckyXiong
     * @date   2024-03-13
     */
    public function sale_center_follow_exception_link_fun($message)
    {
        return (new TestLogic())->follow_exception_link_consumer($message);
    }

    /**
     * @desc  发货队列-执行方法
     * @date  2024/3/18 0021
     * @param $message
     * @return null
     * @author ligang
     */
    public function order_shipping_queue_fun($message)
    {
        return (new OrderShipServiceLogic())->orderShippingQueueConsume($message);
    }

    /**
     * 系统导入详情队列
     * @param $message
     * @return mixed
     * @author: luckyXiong
     * @Date: 2024/3/21
     */
    public function sale_center_system_import_task_detail($message)
    {
        return CommonSystemImportInfoDetailService::staticModel()->system_import_task_detail($message);
    }


    /**
     * @Notes:队列：系统导入消费队列sale_center_system_import_task
     * @Author: xx
     * @Date: 2024/3/21
     * @Time: 17:19
     * @param $message
     * @return bool|mixed
     */
    public function sale_center_system_import_task($message)
    {
        return CommonSystemImportService::staticModel()->consume_center_system_import_queue($message);
    }


    /**
     * @Notes:队列：系统导出消费队列sale_center_system_export_task
     * @author: luckyXiong
     * @date   2024-08-08
     * @Time:  17:19
     * @param $message
     */
    public function sale_center_system_export_task_fun($message)
    {
        return (new CommonExportInfoDetailService())->createCsvInfo($message);
    }









    
     /**
     * 网红订单-发货队列-执行方法
     * @desc  网红订单-发货队列-执行方法
     * @date  2024/3/20 0021
     * @param $message
     * @return null
     * @author ligang
     */
    public function wh_order_shipping_queue_fun($message)
    {
        return (new OrderWhServiceLogic())->orderWhShippingQueueConsume($message);
    }

    /**
     * @desc  创建面单-执行方法
     * @date  2024/3/20 0021
     * @param $message
     * @return null
     * @author ligang
     */
    public function tik_order_shipping_document_queue_fun($message)
    {
        return (new OrderDocumentServiceLogic())->orderShippingDocumentsQueueConsume($message);
    }


    /**
     * @desc     TIK买面单生成PDF失败处理
     * @atuthor  luckyXiong
     * @date     2024-05-11
     */
    public function sale_center_order_document_change_queue_fun($message)
    {
        return  (new TiktokPackageApiService())->downChangeDocUrl($message);
    }



    /**
     * 获取tiktok店铺列表数据列表队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024/4/09
     */
    public function tik_order_list_queue_fun($message)
    {
        return (new OrderLogic())->getOrderListConsumer($message);
    }



    /**
     * 获取tiktok店铺列表数据列表队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024/4/09
     */
    public function tik_order_info_update_queue_fun($message)
    {
        return (new OrderLogic())->getOrderInfoConsumer($message);
    }


    /**
     * 获取tiktok店铺列表数据列表队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024/4/09
     */
    public function jinyi_tracking_number_update_queue_fun($message)
    {
        return (new JinyiApiService())->tracking_number_update_consumer($message);
    }



    /**
     * 获取tiktok广告系列广告花费
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024/4/09
     */
    public function tiktok_integrated_list_queue_fun($message)
    {
        return (new ApiAdvaccountLogic())->tiktok_integrated_list($message);
    }

    /**
     * 每天转点之后更新所有广告账户当天的数据
     * @param   $message
     * @return  mixed
     * @author: zhangheng
     * @Date:   2024/4/09
     */
    public function tiktok_campaign_list_queue_fun($message)
    {
        return (new ApiAdvaccountLogic())->tiktok_campaign_list($message);
    }

    /**
     * 临时任务
     * @param   $message
     * @return  mixed
     * @author: zhangheng
     * @Date:   2024/4/09
     */
    public function tiktok_temporary_tasks_queue_fun($message)
    {
        return (new ApiAdvaccountLogic())->temporary_tasks($message);
    }


    /**
     * 临时任务  顺丰月度对账
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/4/22
     */
    public function tik_order_month_sf_queue_fun($message)
    {
        return (new BillLogic())->importSFComsumer($message);
    }



    /**
     * 临时任务  前程无忧月度对账
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/4/22
     */
    public function tiktok_qc_month_order_queue_fun($message)
    {
        return (new BillQcLogic())->checkQcComsumer($message);
    }


    /**
     * 临时任务  获取shippingfee
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/4/26
     */
    public function tiktok_fee_order_queue_fun($message)
    {
        return (new OrderLogic())->shipping_fee_consumer($message);
    }





    /**
     * 物流单号更新队列
     * @param   $message
     * @return  mixed
     * @author: xx
     * @Date:   2024/5/16
     */
    public function tik_order_update_track_number_queue_fun($message)
    {
        return (new OrderServiceLogic())->updateUserName($message);
    }




    /**
     * @desc    shopify历史数据清洗
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-07-10
     */
    public function tik_order_shopify_change_queue_fun($message)
    {
        return  (new TestLogic())->shopify_change($message);
    }



    /**
     * @desc    运单号数据推到shopify队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-07-12
     */
    public function tik_track_to_shopify_queue_fun($message)
    {
        return  (new TestLogic())->trackShopify($message);
    }


    /**
     * @desc  订单webhook队列-执行方法
     * @date  2024/7/17
     * @param $message
     * @return null
     * @author zhangheng
     */
    public function order_webhook_queue_fun($message)
    {
        return (new WebhookLogic())->orders_creates_consumer($message);
    }

    /**
     * @desc  更新订单详情webhook队列-执行方法
     * @date  2024/7/17
     * @param $message
     * @return null
     * @author zhangheng
     */
    public function order_webhook_edit_queue_fun($message)
    {
        return (new WebhookLogic())->orders_updateds($message);
    }



    /**
     * @desc    产品库存更新队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-07-22
     */
    public function order_inventory_upload_queue_fun($message)
    {
        return  (new ProductInventoryLogic())->importInventoryConsumer($message);
    }


    /**
     * @desc    产品数据导入队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-07-23
     */
    public function order_product_import_queue_fun($message)
    {
        return  (new ProductLogic())->importProductConsumer($message);
    }



    /**
     * @desc    产品数据上新队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-07-24
     */
    public function order_new_product_upload_queue_fun($message)
    {
        return  (new ProductNewLogic())->uploadProductConsumer($message);
    }


    /**
     * @desc    产品数据上新队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-07-24
     */
    public function order_product_spu_queue_fun($message)
    {
        return  (new ProductInventoryLogic())->updateSpuConsumer($message);
    }



    /**
     * @desc    导出csv数据队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-08-12
     */
    public function order_export_csv_queue_fun($message)
    {
        return  (new CommonExportCsvTaskLogService())->createCsvConsumer($message);
    }


    /**
     * @desc    导出csv数据队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-08-12
     */
    public function order_product_spu_month_queue_fun($message)
    {
        return  (new TestLogic())->spuMonthConsumer($message);
    }

    /**
     * @desc    物流账单导入
     * @param   $message
     * @return  mixed
     * @author: zhangheng
     * @Date:   2024-08-20
     */
    public function order_logistics_import_queue_fun($message)
    {
        return  (new OrderCheckLogisticsLogic())->importLogistics($message);
    }


    /**
     * @desc    广告数据获取队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-10-07
     */
    public function order_advertise_get_queue_fun($message)
    {
        return  (new ApiAdvLogic())->integrated_get_fb_consumer($message);
    }


    /**
     * @desc    产品开发类型队列
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-10-20
     */
    public function order_product_dev_queue_fun($message)
    {
        return  (new TeamLogic())->upDevelopTypeConsumer($message);
    }


    /**
     * @desc    获取员工花名册信息
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-10-31
     */
    public function order_employ_status_queue_fun($message)
    {
        return  (new FeiShuMessageLogic())->upEmployeesConsumer($message);
    }


    /**
     * @desc    获取员工花名册信息
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-11-27
     */
    public function product_to_shop_queue_fun($message)
    {
        return  (new ListingLogic())->copy_product_consumer($message);
    }



    /**
     * @desc    产品刊登到店铺,下架,上架处理
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-12-02
     */
    public function product_send_up_under_queue_fun($message)
    {
         return  (new ShopifyListingLogic())->send_product_consumer($message);
    }





    /**
     * @desc    产品历史信息数据拉取
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-12-02
     */
    public function product_history_queue_fun($message)
    {

         return  (new ShopifyListingLogic())->get_product_consumer($message);

    }


    /**
     * @desc    获取fb,google广告数据消费
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-12-09
     */
    public function advertise_cost_queue_fun($message)
    {
        return  (new CheckLogic())->get_advertise_consumer($message);
    }


    /**
     * @desc    添加变体ID
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-12-09
     */
    public function order_update_varient_queue_fun($message)
    {
        return  (new ApiOrderLogic())->addCalculatedOrder($message);
    }


    /**
     * @desc    添加折扣
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-12-09
     */
    public function order_add_discount_queue_fun($message)
    {
        return  (new ApiOrderLogic())->addDiscountOrder($message);
    }


    /**
     * @desc    track
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-12-09
     */
    public function order_track_17_queue_fun($message)
    {
        return  (new CheckLogic())->get_track_info($message);
    }

    /**
     * @desc    回复邮件消息
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2024-12-09
     */
    public function email_reply_queue_fun($message)
    {
        return  (new CheckLogic())->email_reply($message);
    }


    /**
     * @desc    标签变更
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-01-24
     */
    public function eamil_tag_queue_fun($message)
    {
        return  (new CheckLogic())->email_tag($message);
    }


    /**
     * @desc    退款队列处理
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-02-24
     */
    public function order_refund_queue_fun($message)
    {
        return  (new OrderRefundLogic())->order_refund_consumer($message);
    }


    /**
     * @desc    sku图片队列处理
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-02-24
     */
    public function product_image_sku_queue_fun($message)
    {
        return  (new UploadTestLogic())->upload_shopify_image($message);
    }



    /**
     * @desc    1688订单队列处理
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-03-24
     */
    public function order_ali_queue_fun($message)
    {
        return  (new Vip1688Logic())->do_submit_1688($message);
    }


    /**
     * @desc    匹配海外仓库存
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-04-01
     */
    public function order_hwc_queue_fun($message)
    {
        return  (new TestLogic())->test_hwc_order($message);
    }


    /**
     * @desc    海外仓库存更新
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-04-08
     */
    public function order_hwc_inventory_queue_fun($message)
    {
        return  (new CheckLogic())->consumer_hwc_inventory($message);
    }


    /**
     * @desc    海外仓拆分接口消费方法
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-04-11
     */
    public function order_hwc_split_queue_fun($message)
    {
        return  (new OrderSplitLogic())->splitOrder($message);
    }



    /**
     * @desc    历史访问页面数据
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-04-25
     */
    public function order_page_visit_queue_fun($message)
    {
        return  (new TeamLogic())->getVisitListDetail($message);
    }


    /**
     * @desc    历史访问页面数据
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-04-25
     */
    public function order_page_history_queue_fun($message)
    {
        return  (new TeamLogic())->getHistoryVisitDetail($message);
    }



    /**
     * @desc    历史访问页面数据
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-06-18
     */
    public function order_contact_queue_fun($message)
    {
        return  (new ContractLogic())->confirm_order_consumer($message);
    }


    /**
     * @desc    历史访问页面数据
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-06-18
     */
    public function order_stock_sku_queue_fun($message)
    {
        return  (new FeiShuMessageLogic())->get_stock_info($message);
    }


    /**
     * @desc    历史访问页面数据
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-06-18
     */
    public function order_sku_size_queue_fun($message)
    {
        return  (new LinXingOrderLogic())->change_sku_size_consumer($message);
    }


    /**
     * @desc    sku统计
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-06-18
     */
    public function order_product_sku_plan_queue_fun($message)
    {
        return  (new ApiStockUpLogic())->add_sku_plan($message);
    }

    /**
     * @desc    达人合作数据获取
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-08-18
     */
    public function order_kol_info_queue_fun($message)
    {
        return  (new KolMessageLogic())->cooperate_data_consumer($message);
    }


    /**
     * @desc    达人合作订单数据获取
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-08-18
     */
    public function order_kol_track_queue_fun($message)
    {
        return  (new KolMessageLogic())->cooperate_order_consumer($message);
    }


    /**
     * @desc    达人合作素材数据获取
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-08-18
     */
    public function order_kol_video_queue_fun($message)
    {
        return  (new KolMessageLogic())->cooperate_video_consumer($message);
    }


    /**
     * @desc    达人合作素材存储
     * @param   $message
     * @return  mixed
     * @author: luckyXiong
     * @Date:   2025-08-15
     */
    public function kol_video_local_queue_fun($message)
    {
        return  (new KolMessageLogic())->cooperate_video_local_consumer($message);
    }

}
